package com.salt.admin.api.utils;

import com.salt.admin.api.feign.client.UserClient;
import com.salt.admin.api.model.DataRule;
import com.salt.admin.api.model.Role;
import com.salt.admin.api.model.User;
import com.salt.common.utils.SpringContextHolder;

import java.util.List;

/**
 * @Description
 * @Author salt
 * @Date 2020/8/12 14:54
 * @Version 1.0
 */
public class UserClientUtils {

    private static UserClient userClient = SpringContextHolder.getBean(UserClient.class);

    public static User get(String id){
        return userClient.get(id);
    }

    public static User getUser(){
        return userClient.getUser();
    }

    public static User getByUserName(String name){
        return userClient.getByUserName(name);
    }

    public static List<DataRule> getDataRuleList(){
        return userClient.getDataRuleList();
    }

    public static List<Role> getRoleList(){
        return userClient.getRoleList();
    }

    public static User getUserByLoginName(String loginName){
        return userClient.getUserByLoginName(loginName);
    }

}
